function clifAction() {
	ar3++;
	fra3++;
	if (ar3 < -40) {
		drawBuil(0);
		normalRoof(); //静止
	} else if (range(-40, 20)) {
		blockDown(5, clif); //掉下
		drawBuil(0);
		normalRoof();

	} else if (range(20, 80)) {
		blockDown(33, clif); //掉下
		drawBuil(0);
		normalRoof();

	} else if (range(80, 140)) {
		drawBuil(0);
		blockDown(60, clif); //掉下
		normalRoof();

	} else if (range(140, 200)) {
		drawBuil(0);
		blockDown(87, clif); //block全部掉下来
		normalRoof();

	} else if (range(200, 260)) {
		drawBuil(0);
		normalRoof();
		mctx.drawImage(clif, 78, 87); //静止一会
	} else if (range(260, 320)) {
		drawBuil(0);
		normalRoof();
		mctx.drawImage(black, 78, 87);//黑脸一会
	} else if (range(320, 380)) {
		black.src = "images/black2.png";
		drawBuil(0);
		normalRoof();
		mctx.drawImage(clif, 78, 87); //静止一会
	} else if (range(380, 407)) {
		black.src = "images/black2.png";
		ar1 += 0.3;
		drawBuil(parabola(ar1, -8.1));
		normalRoof();
		clifStepDown(87 - parabola(ar1, -8.1)); //向下压
	} else if (range(407, 457)) {
		ar2 += 0.3;
		drawBuil(0);
		clifRotate(parabola(ar2, -15)); //转起来
	} else {
		drawBuil(0);
		normalRoof();
	}
	if (range(407, 467)) {
		ar4 += 0.3;
		drawBuil(0);
		roofJump(parabola(ar4, -17)); //跳起来
	}
	if(fra3>477){
	fighter();
	}
}

function range(st, nd) {
	return ar3 >= st && ar3 < nd;
}

function clifStepDown(y) {
	mctx.drawImage(clif, 78, y);
}
function blackface(){
}
function clifRotate(y) {
	if (fra >= 49) {
		fra = 0;
		ar1 = 0;
		ar2 = 0;
		ar3 = 200;
		ar4 = 0;
		alpha = 0;
	}
	radian += Math.sin(alpha);
	fra++;

	mctx.save();
	mctx.translate(103, 113 + y);
	mctx.rotate(radian);
	mctx.drawImage(clif, -25, -26);
	mctx.restore();

	alpha += Math.PI / 50;

	clif.src = "images/clif2.png";

}

function roofJump(y) {
	if (fra2 >= 59) {
		alpha2 = 0;
		fra2 = 0;
	}
	radian2 = Math.sin(alpha2)/4;
	fra2 ++;

	mctx.save();
	mctx.translate(105,y+70);
	mctx.rotate(radian2);
	mctx.drawImage(roof, -105,9);
	mctx.restore();

	alpha2 += Math.PI /60;
}

function parabola(x, b) {
	return x * x + b * x;
}

function blockDown(y, obj) {
	mctx.drawImage(obj, 78, y);
}
function normalRoof(){
		mctx.drawImage(roof, 0, 65);
}